import {proTypeArray, widgetTypeArray} from "../common";
import {tableOptBtnConfig} from "../table";

export default {
  "tableId": "compositeWidget",
  "name": "组件",
  "columns": [
    {
      label: '组件名称',
      width: 200,
      children: [
        {
          key: 'name',
          tooltip: true
        },
      ]
    },
    {
      label: '协议类型',
      width: 200,
      children: [
        {
          key: 'protocolTypeText',
        },
      ]
    },
    {
      label: '组件功能',
      width: 120,
      children: [
        {
          key: 'categoryText'
        },
      ]
    },
    {
      label: '设备类别',
      width: 120,
      children: [
        {
          key: 'deviceTypeText'
        },
      ]
    },
    {
      label: '组件状态',
      width: 120,
      children: [
        {
          key: 'status'
        },
      ]
    },
    {
      label: '组件大小',
      width: 120,
      children: [
        {
          key: 'widgetSizes'
        },
      ]
    },
    {
      label: '预览图',
      "width": 150,
      children: [
        {
          image: true,
          key: 'previewImages'
        },
      ]
    },
    {
      label: '备注',
      width: 150,
      children: [
        {
          key: 'remarks'
        },
      ]
    },
    {
      label: '更新时间',
      width: 100,
      children: [
        {
          updatedDate: true
        }
      ],
    },
    {
      "label": "操作",
      "operation": true,
      "width": 250,
      "children": [
        {
          "button": true,
          type: tableOptBtnConfig.select.type,
        },
        {
          "button": true,
          type: tableOptBtnConfig.preview.type,
        },
        {
          "button": true,
          type: tableOptBtnConfig.edit.type,
        },
        {
          'dropdown': true,
          'options': [
            {
              'type': tableOptBtnConfig.copy.type
            },
            {
              'type': tableOptBtnConfig.delete.type,
              'class': 'hover-font-danger'
            },

            {
              'type': tableOptBtnConfig.release.type,
              'showKey': 'releaseBtn',
            },
            {
              'type': tableOptBtnConfig.deleteRelease.type,
              'showKey': 'deleteReleaseBtn',
            },
            {
              'type': tableOptBtnConfig.export.type,
              label: '导出组件配置',
            },
            {
              'type': tableOptBtnConfig.exportZip.type,
              label: '导出组件资源包',
            },
          ]
        }
      ]
    }
  ],
  "filters": [
    {
      "fieldType": "input",
      key: 'name',
      label: '组件名称'
    },
    {
      "fieldType": "input",
      key: 'createdByName',
      label: '创建人'
    },

    {
      "fieldType": "string",
      key: 'deviceType',
      label: '设备类别',
      "dataApi": API.deviceType.deviceTypeAll,
      "options": []
    },
    {
      "fieldType": "string",
      key: 'widgetType',
      label: '组件功能',
      "options": widgetTypeArray
    },
    // {
    //   "fieldType": "string",
    //   key: 'isGeneralWidget',
    //   label: '协议类型',
    //   "options": proTypeArray
    // },
  ]
}
